<template>
	<view class="j-l-trac">
		<template v-if="logistics.length">
			<u-time-line>
				<u-time-line-item v-for="(item,index) in logistics" :key="index">
					<template v-slot:content>
						<view>
							<!-- <view class="u-order-title"></view> -->
							<view class="u-order-desc">{{item.context}}</view>
							<view class="u-order-time">{{item.time}}</view>
						</view>
					</template>
				</u-time-line-item>
			</u-time-line>
		</template>
		<template v-else>
			<view class="j-a-empty"><u-empty></u-empty></view>
		</template>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				params: {
					mallOrderId: ''
				},
				logistics:[]
			}
		},
		onLoad(e) {
			this.params.mallOrderId = e.mallOrderId;
			this.postGetOrderMallById();
		},
		methods:{
			// 查询订单详情
			postGetOrderMallById() {
				this.$u.api
					.postGetOrderMallById(this.params)
					.then(res => {
						console.log(res, '[商品订单物流跟踪页-查询订单详情接口]');
						this.logistics = JSON.parse(res.data.logistics).data;
					})
					.catch(err => {
						console.log(err);
						this.$refs.cancelOrder.clearLoading();
					});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.j-a-empty{
		margin-top: 60rpx;
	}
	.j-l-trac{
		padding: 25rpx 25rpx 25rpx 48rpx;
	}
	.u-node {
		width: 44rpx;
		height: 44rpx;
		border-radius: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #d0d0d0;
	}
	
	.u-order-title {
		color: #333333;
		font-weight: bold;
		font-size: 32rpx;
	}
	
	.u-order-desc {
		color: rgb(150, 150, 150);
		font-size: 28rpx;
		margin-bottom: 6rpx;
	}
	
	.u-order-time {
		color: rgb(200, 200, 200);
		font-size: 26rpx;
	}
</style>